package com.atguigu.tingshu.album.client;

import com.atguigu.tingshu.album.client.impl.AlbumInfoDegradeFeignClient;
import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.album.AlbumInfo;
import com.atguigu.tingshu.model.album.BaseCategory3;
import com.atguigu.tingshu.model.album.BaseCategoryView;
import com.atguigu.tingshu.model.album.TrackInfo;
import com.atguigu.tingshu.vo.album.AlbumStatVo;
import com.atguigu.tingshu.vo.album.TrackListVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 产品列表API接口
 * </p>
 *
 */
@FeignClient(value = "service-album",
        path = "/api/inner/albuminfo",
        contextId = "albumInfoFeignClient",
        fallback = AlbumInfoDegradeFeignClient.class)
public interface AlbumInfoFeignClient {

    /**
     * 根据专辑Id获取专辑信息
     * @param albumId
     * @return
     */
    @GetMapping("/getAlumInfo/{albumId}")
    Result<AlbumInfo> getAlbumInfo(@PathVariable(value = "albumId") Long albumId);

    /**
     * 根据专辑Id获取专辑分类信息
     * @param albumId
     * @return
     */
    @GetMapping("/getAlbumInfoCategory/{albumId}")
    Result<BaseCategoryView> getAlbumInfoCategory(@PathVariable(value = "albumId") Long albumId);

    /**
     * 根据专辑Id获取专辑统计信息
     * @param albumId
     * @return
     */
    @GetMapping("/getAlbumInfoStat/{albumId}")
    Result<AlbumStatVo> getAlbumInfoStat(@PathVariable(value = "albumId") Long albumId);

    /**
     * 根据一级分类Id获取到一级分类下的7个二级分类包含的三级分类列表
     * @param c1Id
     * @return
     */
    @GetMapping("/getC1Id7TopBaseCategory3List/{c1Id}")
    Result<List<BaseCategory3>> getC1Id7TopBaseCategory3List(@PathVariable(value = "c1Id") Long c1Id);

    /**
     * 获取所有专辑Id
     * @return
     */
    @GetMapping("/getAllAlbumInfoIds")
    public Result<ArrayList<Long>> getAllAlbumInfoIds();

    /**
     * 通过专辑Id 获取到专辑状态信息
     * @param albumId
     * @return
     */
    @GetMapping("api/album/albumInfo/getAlbumStatVo/{albumId}")
    Result<AlbumStatVo> getAlbumStatVo(@PathVariable Long albumId);

    /**
     * 获取一级分类Id列表
     * @return
     */
    @GetMapping("/getCategory1IdList")
    Result<List<Long>> getCategory1IdList();

    /**
     * 获取专辑的播放列表
     * @param collectTrackIds
     * @return
     */
    @PostMapping("/getTrackInfoList")
    Result<List<TrackListVo>> getTrackInfoList(@RequestBody List<Long> collectTrackIds);


    @GetMapping("/getTrackInfoById/{trackId}")
    Result<TrackInfo> getTrackInfoById(@PathVariable(value = "trackId") Long trackId);

    @GetMapping("/getPaidTrackAndFilterCanPayTrack/{albumId}/{userId}/{trackCount}/{trackId}")
    Result<List> getPaidTrackAndFilterCanPayTrack(@PathVariable(value = "albumId") Long albumId,
                                                  @PathVariable(value = "userId") Long userId,
                                                  @PathVariable(value = "trackCount") Integer trackCount,
                                                  @PathVariable(value = "trackId") Long trackId);



}